<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        
    </style>
</head>
<body>
    
</body>
<script>

    const xhr = new XMLHttpRequest();
    xhr.open("get", "http://127.0.0.1:5500/code/day25/data/user.json");
    xhr.onreadystatechange = function(){
        // console.log(xhr.readyState);
        // console.log( xhr.status );
        if(xhr.readyState === 4 && xhr.status === 200){
            // 请求成功
            console.log(xhr.responseText);
        }else if(xhr.readyState === 4 && xhr.status !== 200){
            // 请求失败
            console.log(xhr.status);
        }
    }
    xhr.send();
    
</script>
</html>